<?php
/**
 * Anniversary.php
 * 文件描述 纪念日控制器
 * Created on 2020/8/31 11:46
 * Created by 刘小龙 595929049@qq.com
 */

namespace app\xiangji\controller;


use app\Request;
use app\xiangji\BaseController;
use app\xiangji\services\QuestionService;
use think\App;

class LoveQuestion extends BaseController
{
    private $questionService;

    public function __construct(QuestionService $questionService)
    {
        $this->questionService = $questionService;
    }

    public function index(Request $request)
    {
        $result = $this->questionService->search($request);
        return $this->success($result);
    }

    public function show($id)
    {
        $result = $this->questionService->show($id);
        return $this->success($result);
    }

    public function answer(Request $request, $id)
    {
        $result = $this->questionService->answerQuestion($request, $id);
        return $this->success($result);
    }
}